package com.echat.business.blog.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * <p>
 * </p>
 *
 * @author chentl123
 * @since 2019-10-08
 */
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
@TableName("echo_business_blog_comment")
public class BlogComment extends Model<BlogComment> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 关联博客id
     */
    private Integer blogId;
    /**
     * 评论者id（关联user表）
     */
    private Integer reviewerId;
    /**
     * 评论内容
     */
    private String content;
    /**
     * 评论时间
     */
    private Date createTime;
    /**
     * 点赞人数
     */
    private Integer likeNum;
    /**
     * 评论列表
     */
    @TableField(exist = false)
    private List<BlogReply> reply;
    /**
     * 头像
     */
    @TableField(exist = false)
    private String avatar;
    /**
     * 用户名
     */
    @TableField(exist = false)
    private String name;

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<BlogReply> getReply() {
        return reply;
    }

    public void setReply(List<BlogReply> reply) {
        this.reply = reply;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBlogId() {
        return blogId;
    }

    public void setBlogId(Integer blogId) {
        this.blogId = blogId;
    }

    public Integer getReviewerId() {
        return reviewerId;
    }

    public void setReviewerId(Integer reviewerId) {
        this.reviewerId = reviewerId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getLikeNum() {
        return likeNum;
    }

    public void setLikeNum(Integer likeNum) {
        this.likeNum = likeNum;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "BlogComment{" +
                ", id=" + id +
                ", blogId=" + blogId +
                ", reviewerId=" + reviewerId +
                ", content=" + content +
                ", createTime=" + createTime +
                ", likeNum=" + likeNum +
                "}";
    }
}
